package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.RentalSuppliersMapper;
import com.hello.system.domain.RentalSuppliers;
import com.hello.system.service.IRentalSuppliersService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 设备供应商Service业务层处理
 * 
 * @author hello
 * @date 2025-08-06
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class RentalSuppliersServiceImpl extends ServiceImpl<RentalSuppliersMapper, RentalSuppliers> implements IRentalSuppliersService 
{
    private final RentalSuppliersMapper rentalSuppliersMapper;

    /**
     * 查询设备供应商
     * 
     * @param supplierId 设备供应商主键
     * @return 设备供应商
     */
    @Override
    public RentalSuppliers selectRentalSuppliersBySupplierId(Long supplierId)
    {
        return rentalSuppliersMapper.selectRentalSuppliersBySupplierId(supplierId);
    }

    /**
     * 查询设备供应商列表
     * 
     * @param rentalSuppliers 设备供应商
     * @return 设备供应商
     */
    @Override
    public List<RentalSuppliers> selectRentalSuppliersList(RentalSuppliers rentalSuppliers)
    {
        return rentalSuppliersMapper.selectRentalSuppliersList(rentalSuppliers);
    }

    /**
     * 新增设备供应商
     * 
     * @param rentalSuppliers 设备供应商
     * @return 结果
     */
    @Override
    public int insertRentalSuppliers(RentalSuppliers rentalSuppliers)
    {
        rentalSuppliers.setCreateTime(DateUtils.getNowDate());
        return rentalSuppliersMapper.insertRentalSuppliers(rentalSuppliers);
    }

    /**
     * 修改设备供应商
     * 
     * @param rentalSuppliers 设备供应商
     * @return 结果
     */
    @Override
    public int updateRentalSuppliers(RentalSuppliers rentalSuppliers)
    {
        rentalSuppliers.setUpdateTime(DateUtils.getNowDate());
        return rentalSuppliersMapper.updateRentalSuppliers(rentalSuppliers);
    }


    /**
     * 批量删除设备供应商
     * 
     * @param supplierIds 需要删除的设备供应商主键
     * @return 结果
     */
    @Override
    public int deleteRentalSuppliersBySupplierIds(Long[] supplierIds)
    {
        return rentalSuppliersMapper.deleteRentalSuppliersBySupplierIds(supplierIds);
    }

    /**
     * 删除设备供应商信息
     * 
     * @param supplierId 设备供应商主键
     * @return 结果
     */
    @Override
    public int deleteRentalSuppliersBySupplierId(Long supplierId)
    {
        return rentalSuppliersMapper.deleteRentalSuppliersBySupplierId(supplierId);
    }
}
